/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package dieci.system;

import dieci.database.PersistentObject;

/**
 *
 * @author Blanco
 */
public class Supplier implements PersistentObject{

    private int supplierId;
    private String name;
    private String contactPerson;
    private String address;
    private String email;
    private String phone;
    private String webSite;
    private int deleted;
    
    public Supplier()
    {
    }

    public Supplier(String name, String contactPerson, String address, 
            String email, String phone, String webSite, int deleted)
    {
        this.name = name;
        this.contactPerson = contactPerson;
        this.address = address;
        this.email = email;
        this.phone = phone;
        this.webSite = webSite;
        this.deleted = deleted;
    }

    public Supplier(int id, String name, String contactPerson, String address, 
            String email, String phone, String webSite, int deleted)
    {
        this(name, contactPerson, address, email, phone, webSite, deleted);
        this.supplierId = id;
    }
    
    /**
     * Get the value of webSite
     *
     * @return the value of webSite
     */
    public String getWebSite()
    {
        return webSite;
    }

    /**
     * Set the value of webSite
     *
     * @param webSite new value of webSite
     */
    public void setWebSite(String webSite)
    {
        this.webSite = webSite;
    }

    /**
     * Get the value of phone
     *
     * @return the value of phone
     */
    public String getPhone()
    {
        return phone;
    }

    /**
     * Set the value of phone
     *
     * @param phone new value of phone
     */
    public void setPhone(String phone)
    {
        this.phone = phone;
    }

    /**
     * Get the value of email
     *
     * @return the value of email
     */
    public String getEmail()
    {
        return email;
    }

    /**
     * Set the value of email
     *
     * @param email new value of email
     */
    public void setEmail(String email)
    {
        this.email = email;
    }

    /**
     * Get the value of address
     *
     * @return the value of address
     */
    public String getAddress()
    {
        return address;
    }

    /**
     * Set the value of address
     *
     * @param address new value of address
     */
    public void setAddress(String address)
    {
        this.address = address;
    }

    /**
     * Get the value of contactPerson
     *
     * @return the value of contactPerson
     */
    public String getContactPerson()
    {
        return contactPerson;
    }

    /**
     * Set the value of contactPerson
     *
     * @param contactPerson new value of contactPerson
     */
    public void setContactPerson(String contactPerson)
    {
        this.contactPerson = contactPerson;
    }
   
        
    /**
     * Get the value of supplierCode
     *
     * @return the value of supplierCode
     */
    public int getSupplierId() {
        return supplierId;
    }

    /**
     * Set the value of supplierCode
     *
     * @param supplierCode new value of supplierCode
     */
    public void setSupplierId(int supplierId) {
        this.supplierId = supplierId;
    }

    /**
     * Get the value of name
     *
     * @return the value of name
     */
    public String getName() {
        return name;
    }

    /**
     * Set the value of name
     *
     * @param name new value of name
     */
    public void setName(String name) {
        this.name = name;
    }

    public int getDeleted() {
        return deleted;
    }

    public void setDeleted(int deleted) {
        this.deleted = deleted;
    }

    @Override
    public String toString(){
        return this.name;
    }   
    
    @Override
    public boolean equals(Object obj) {
        if (obj == null)
            return false;
        if (obj == this)
            return true;
        if (!(obj instanceof Supplier))
            return false;

        return ((Supplier)obj).getSupplierId()== this.supplierId;
    }
}

